#pragma once
#include <cstdint>
#include <vector>
#include <utility>
#include "random_mapping.hpp"

typedef std::pair<std::uint8_t, std::uint8_t> mapping_pair_type;

template<std::uint16_t mapper_size>
std::vector<mapping_pair_type> generateRandomNoReflexiveMappingPairList(const std::uint64_t seed, const std::uint16_t pair_number = (mapper_size / 2))
{
    std::uint16_t count = 0;
    std::uint8_t from, to;
    std::vector<mapping_pair_type> pair_list;
    std::array<std::uint8_t, mapper_size> random_mapping = generateRandomMapping<mapper_size>(seed);

    for (std::uint16_t i = 0; i + 1 < mapper_size && count < pair_number; i += 2) {
        from = random_mapping[i];
        to = random_mapping[i + 1];
        pair_list.push_back({from, to});
        count++;
    }

    return pair_list;
}
